package com.his.common;

import java.awt.Color;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JPasswordField;
import javax.swing.border.LineBorder;

@SuppressWarnings("all")
public class TJPasswordField extends JPasswordField implements MouseListener,
		FocusListener {
	private int thickness = 1;

	public TJPasswordField() {
		setStyle();
	}

	public TJPasswordField(int col) {
		super(col);
		setStyle();
	}

	public TJPasswordField(String text) {
		super(text);
		setStyle();
	}

	public TJPasswordField(String text, int column) {
		super(text, column);
		setStyle();
	}

	public void setLineWidth(int l) {
		this.thickness = l;
		setBorder(new LineBorder(new Color(159, 145, 118), this.thickness));
	}

	private void setStyle() {
		setForeground(new Color(87, 87, 47));
		setBackground(new Color(248, 242, 230));
		setBorder(new LineBorder(new Color(159, 145, 118), this.thickness));
		addMouseListener(this);
		addFocusListener(this);
	}

	public void mouseClicked(MouseEvent me) {
	}

	public void mousePressed(MouseEvent me) {
	}

	public void mouseReleased(MouseEvent me) {
	}

	public void mouseEntered(MouseEvent me) {
		setBorder(new LineBorder(new Color(241, 171, 84), this.thickness));
	}

	public void mouseExited(MouseEvent me) {
		setBorder(new LineBorder(new Color(159, 145, 118), this.thickness));
	}

	public void focusGained(FocusEvent fe) {
		setBorder(new LineBorder(new Color(241, 171, 84), this.thickness));
	}

	public void focusLost(FocusEvent fe) {
		setBorder(new LineBorder(new Color(159, 145, 118), this.thickness));
	}
}